﻿using System;
using System.Collections.Generic;
using System.Text;
using Castle.ActiveRecord;
using Castle.Components.Validator;
using MiragePWF.NH.Validation;
using Wolfut.MirageEE.Kernal.Common;

namespace Wolfut.MirageEE.Domain.Products
{
    /// <summary>
    /// 采购入库信息
    /// </summary>
    /// <remarks>
    /// Author: LEO
    /// Date: 2009-03-15
    /// </remarks>
    [ActiveRecord("PURCHASE_IN_STOCKS")]
    public class ProductInWarehouse : PersistentObjectWithGuid
    {
        #region 采购单ID
        private string _PURCHASE_BILL_ID;
        [Property("PURCHASE_BILL_ID")]
        public virtual string PURCHASE_BILL_ID
        {
            get { return _PURCHASE_BILL_ID; }
            set { _PURCHASE_BILL_ID = value; }
        }
        #endregion

        #region 商品ID
        private string productID = string.Empty;
        [Property("PRODUCT_ID")]
        [ValidateNonEmpty, ValidateLength(0, 40, "商品ID超长")]
        public virtual string ProductID
        {
            get { return productID; }
            set { productID = value; }
        }
        #endregion

        #region 采购单号
        private string purchaseOrderCode = string.Empty;
        [Property("PURCHASE_ORDER_CODE")]
        [ValidateIsUniqueInSameTransactionWithString(false, "数据库已经存在相同的采购单号！")]
        [ValidateNonEmpty, ValidateLength(0, 100, "采购单号超长")]
        public virtual string PurchaseOrderCode
        {
            get { return purchaseOrderCode; }
            set { purchaseOrderCode = value; }
        }
        #endregion

        #region 采购订单ID
        private string _PURCHASE_ORDER_ID;
        [Property("PURCHASE_ORDER_ID")]
        public virtual string PURCHASE_ORDER_ID
        {
            get { return _PURCHASE_ORDER_ID; }
            set { _PURCHASE_ORDER_ID = value; }
        }
        #endregion

        #region 采购类别
        private string purchaseCategory = string.Empty;
        [Property("PURCHASE_CATEGORY")]
        [ValidateNonEmpty, ValidateLength(0, 100, "采购类别超长")]
        public virtual string PurchaseCategory
        {
            get { return purchaseCategory; }
            set { purchaseCategory = value; }
        }
        #endregion

        #region 科目ID
        private string subjectID = string.Empty;
        [Property("SUBJECT_ID")]
        [ValidateNonEmpty, ValidateLength(0, 40, "科目ID超长")]
        public virtual string SubjectID
        {
            get { return subjectID; }
            set { subjectID = value; }
        }
        #endregion

        #region 仓库ID
        private string warehouseID = string.Empty;
        [Property("WAREHOUSE_ID")]
        [ValidateNonEmpty, ValidateLength(0, 40, "仓库ID超长")]
        public virtual string WarehouseID
        {
            get { return warehouseID; }
            set { warehouseID = value; }
        }
        #endregion

        #region 数量
        private decimal quantity;
        [Property("QUANTITY")]
        [ValidateNonEmpty]
        public virtual decimal Quantity
        {
            get { return quantity; }
            set { quantity = value; }
        }
        #endregion

        #region 单价
        private decimal unitPrice;
        [Property("UNIT_PRICE")]
        [ValidateNonEmpty]
        public virtual decimal UnitPrice
        {
            get { return unitPrice; }
            set { unitPrice = value; }
        }
        #endregion

        #region 单价类别
        private string unitPriceCategory = string.Empty;
        [Property("UNIT_PRICE_CATEGORY")]
        [ValidateNonEmpty, ValidateLength(0, 40, "单价类别超长")]
        public virtual string UnitPriceCategory
        {
            get { return unitPriceCategory; }
            set { unitPriceCategory = value; }
        }
        #endregion

        #region 折扣率
        private decimal discountRate;
        [Property("DISCOUTN_RATE")]
        [ValidateNonEmpty]
        public virtual decimal DiscountRate
        {
            get { return discountRate; }
            set { discountRate = value; }
        }
        #endregion

        #region 折扣额
        private decimal discountAmount;
        [Property("DISCOUNT_AMOUNT")]
        [ValidateNonEmpty]
        public virtual decimal DiscountAmount
        {
            get { return discountAmount; }
            set { discountAmount = value; }
        }
        #endregion

        #region 税率
        private decimal taxRate;
        [Property("TAX_RATE")]
        [ValidateNonEmpty]
        public virtual decimal TaxRate
        {
            get { return taxRate; }
            set { taxRate = value; }
        }
        #endregion

        #region 税额
        private decimal taxAmount;
        [Property("TAX_AMOUNT")]
        [ValidateNonEmpty]
        public virtual decimal TaxAmount
        {
            get { return taxAmount; }
            set { taxAmount = value; }
        }
        #endregion

        #region 采购额
        private decimal purchaseAmount;
        [Property("PURCHASE_AMOUNT")]
        [ValidateNonEmpty]
        public virtual decimal PurchaseAmount
        {
            get { return purchaseAmount; }
            set { purchaseAmount = value; }
        }
        #endregion

        #region 金额
        private decimal totalAmount;
        [Property("TOTAL_AMOUNT")]
        [ValidateNonEmpty,]
        public virtual decimal TotalAmount
        {
            get { return totalAmount; }
            set { totalAmount = value; }
        }
        #endregion

        #region 是否删除
        private bool isDeleted;
        [Property("IS_DELETED")]
        [ValidateNonEmpty]
        public virtual bool IsDeleted
        {
            get { return isDeleted; }
            set { isDeleted = value; }
        }
        #endregion
    }
}
